FROM            openjdk:8-jre-alpine
MAINTAINER      Edward Jobs<fatewa.fit@gmail.com>

ARG             PREFIX=/opt/java

ARG             REV
ENV             REV=$REV

COPY            ./application/target/. ${PREFIX}/
COPY            ./run.sh  ${PREFIX}/
COPY            ./migrate  ${PREFIX}/migrate
COPY            ./.env  ${PREFIX}/
COPY            ./db.sh  ${PREFIX}/
COPY            ./version ${PREFIX}/

RUN             chmod 755 ${PREFIX}/migrate/bin/migrate ${PREFIX}/run.sh ${PREFIX}/db.sh

RUN             sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories

WORKDIR         ${PREFIX}
CMD             ["sh", "./run.sh"]

EXPOSE          3000
EXPOSE          3005


